package cn.iocoder.yudao.module.pay.splitting.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 商户类型枚举

 * @author 山野羡民
 */
@Getter
@AllArgsConstructor
public enum SplittingMerchantTypeEnum implements EnumValuable {

    Personal(0, "小微"),
    SelfEmployed(1, "个体户"),
    Enterprise(2, "企业"),
    ;

    private final Integer value;
    private final String name;

    public static SplittingMerchantTypeEnum valueOf(Integer status) {
        for (SplittingMerchantTypeEnum value : values()) {
            if (Objects.equals(value.getValue(), status)) {
                return value;
            }
        }
        return Personal;
    }

}
